﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.ComponentModel;

namespace WebComponents.Templates.AdminControlProj
{
    [
   Designer(typeof(ACPPageDesigner)),
   DefaultProperty("Title"),
   ToolboxBitmap(typeof(ACPPage), "WebComponents.Templates.AdminControlProj.Images.ACPPage.bmp"),
   ToolboxData("<{0}:Template runat=\"server\"> </{0}:Template>"),
   ]
    public class Template : CompositeControl
    {
        private ITemplate messageTemplate = null;

        [TemplateContainer(typeof(MessageContainer))]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        public ITemplate MessageTemplate
        {
            get
            {
                return messageTemplate;
            }
            set
            {
                messageTemplate = value;
            }
        }

   
        public class MessageContainer : Control, INamingContainer
        {
            private int m_index;
            private String m_message;
            internal MessageContainer(int index, String message)
            {
                m_index = index;
                m_message = message;
            }
            public int Index
            {
                get
                {
                    return m_index;
                }
            }
            public String Message
            {
                get
                {
                    return m_message;
                }
            }
        }
    }
}
